package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Config struct {
	MysqlConfig
}
type MysqlConfig struct {
	Host string
	Port string
	User string
	Pass string
}

var Conf Config

func InitConfig() {
	viper.SetConfigFile("./config/config.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	viper.Unmarshal(&Conf)
	fmt.Println("viper 配置成功:", Conf)
}
